package com.lytoyo.neihanduanzi.model.index;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * Package:com.lytoyo.neihanduanzi.model.index
 *
 * @ClassName:BlogIndex
 * @Create:2025/4/3 15:41
 **/
@Document(indexName = "blog")
@JsonIgnoreProperties(ignoreUnknown = true)
@Accessors(chain = true)
@Data
public class BlogIndex implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    private Long id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String title;

    //视频的第一帧画面或图片的第一张
    @Field(type = FieldType.Keyword)
    private String picture;

    //视频类型，0为图片，1为视频
    @Field(type = FieldType.Integer)
    private Integer blogType;

    @Field(type = FieldType.Long)
    private Long liked;

    @Field(type = FieldType.Keyword)
    private String nickname;

    @Field(type = FieldType.Keyword)
    private String headPhoto;

    @Field(type = FieldType.Date)
    private Date date;
}
